﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace Zatify.WebUI.Models
{
    public class IndividualViewModel
    {
        public Double TimeZoneOffset { get; set; }

        [Required(ErrorMessage = "User ID required")]
        [Remote("IndividualUserIDUnique", "Registration", ErrorMessage="User ID must be unique.")]
        [RegularExpression("^[a-zA-Z0-9]{6,16}$", ErrorMessage = "The user id must be 6-16 characters long and contain only alpha-numeric characters")]        
        public string UserID { get; set; }

        [Required(ErrorMessage = "Password required")]
        [RegularExpression("^[a-zA-Z0-9]{6,16}$", ErrorMessage = "The password must be 6-16 characters long and contain only alpha-numeric characters")]
        public string Password { get; set; }

        [Required(ErrorMessage = "Confirm Password required")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Please enter a valid e-mail address")]
        //[Required(ErrorMessage = "Email required")]
        [StringLength(50, ErrorMessage = "Email cannot be longer than 50 characters.")]
        [Remote("IndividualUserEmailUnique", "Registration", ErrorMessage = "Email must be unique.")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Zip Code required")]
        [RegularExpression(@"^\d{5}(-\d{4})?$", ErrorMessage = "Zip code must be 5 characters length")]
        public string ZipCode { get; set; }

        //[Required(ErrorMessage = "Phone required")]
        [StringLength(50, ErrorMessage = "Phone cannot be longer than 50 characters.")]
        public string Phone { get; set; }
        [StringLength(100, ErrorMessage = "Referred By cannot be longer than 100 characters.")]
        public string ReferredBy { get; set; }

        public byte[] Photo { get; set; }
        public string PhotoContentType { get; set; }
    }
}